/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sss.tools;

import java.util.ArrayList;
import java.util.List;

/**
 * Class representing a node, which is located in the graph search.
 * @author Przemyslaw Wojtysiak
 */
public class Node {
    private Double distance;
    private Shop shop;
    private Node parent;
    private int depth;
    private List<Product> productsInShop;
    private List<ProductShop> actualProducts;
    private List<Node> nodeToVisit;
    private int actualNumberOfProducts;
    private Double actualPriceForProducts;
    private Double totalPrice;
    private Double time;
    
    /**
     * Node class constructor 
     */
    public Node(){
        productsInShop = new ArrayList<Product>();
        actualProducts = new ArrayList<ProductShop>();
        nodeToVisit = new ArrayList<Node>();
    }
    
    /**
     * Node class constructor 
     * @param node
     */
    public Node(Node node){
        this.distance = node.getDistance();
        this.shop = node.getShop();
        this.parent = null;
        this.depth = node.getDepth();
        this.productsInShop = new ArrayList<Product>(node.getProductsInShop());
        this.actualProducts = new ArrayList<ProductShop>(node.getActualProducts());
        this.actualNumberOfProducts = node.getActualNumberOfProducts();
        this.actualPriceForProducts = node.getActualPriceForProducts();
        this.totalPrice = node.getTotalPrice();
        this.nodeToVisit = new ArrayList<Node>(node.getNodeToVisit());
        this.time = node.getTime();
    }
    
    /**
     * Node class constructor 
     * @param distance
     * @param shop
     * @param parent
     * @param depth
     * @param productsInShop
     * @param actualProducts
     * @param actualNumberOfProducts
     * @param actualPriceForProducts
     * @param totalPrice
     * @param time
     */
    public Node(Double distance, Shop shop, Node parent, int depth, 
            List<Product> productsInShop, List<ProductShop> actualProducts, int actualNumberOfProducts,
            Double actualPriceForProducts, Double totalPrice, Double time) {
        this.distance = distance;
        this.shop = shop;
        this.parent = parent;
        this.depth = depth;
        this.productsInShop = productsInShop;
        this.actualProducts = actualProducts;
        this.actualNumberOfProducts = actualNumberOfProducts;
        this.actualPriceForProducts = actualPriceForProducts;
        this.totalPrice = totalPrice;
        this.nodeToVisit = new ArrayList<Node>();
        this.time = time;
    }
    
    /**
     * Node class constructor 
     * @param distance
     * @param shop
     * @param depth
     * @param productsInShop
     * @param actualProducts
     * @param actualNumberOfProducts
     * @param actualPriceForProducts
     * @param totalPrice
     * @param time
     */
    public Node(Double distance, Shop shop, int depth, 
            List<Product> productsInShop, List<ProductShop> actualProducts, int actualNumberOfProducts,
            Double actualPriceForProducts, Double totalPrice, Double time) {
        this.distance = distance;
        this.shop = shop;
        this.depth = depth;
        this.productsInShop = productsInShop;
        this.actualProducts = actualProducts;
        this.actualNumberOfProducts = actualNumberOfProducts;
        this.actualPriceForProducts = actualPriceForProducts;
        this.totalPrice = totalPrice;
        this.nodeToVisit = new ArrayList<Node>();
        this.time = time;
    }
    
    /**
     * Node class constructor 
     * @param distance
     * @param shop
     * @param depth
     * @param actualNumberOfProducts
     * @param actualPriceForProducts
     * @param totalPrice
     * @param time
     */
    public Node(Double distance, Shop shop, int depth, int actualNumberOfProducts,
            Double actualPriceForProducts, Double totalPrice, Double time) {
        this.distance = distance;
        this.shop = shop;
        this.depth = depth;
        productsInShop = new ArrayList<Product>();
        actualProducts = new ArrayList<ProductShop>();
        this.actualNumberOfProducts = actualNumberOfProducts;
        this.actualPriceForProducts = actualPriceForProducts;
        this.totalPrice = totalPrice;
        this.nodeToVisit = new ArrayList<Node>();
        this.time = time;
    }
    
    /**
     * @return the distance
     */
    public Double getDistance() {
        return distance;
    }

    /**
     * @param distance the distance to set
     */
    public void setDistance(Double distance) {
        this.distance = distance;
    }

    /**
     * @return the shop
     */
    public Shop getShop() {
        return shop;
    }

    /**
     * @param shop the shop to set
     */
    public void setShop(Shop shop) {
        this.shop = shop;
    }

    

    /**
     * @return the parent
     */
    public Node getParent() {
        return parent;
    }

    /**
     * @param parent the parent to set
     */
    public void setParent(Node parent) {
        this.parent = parent;
    }

    /**
     * @return the depth
     */
    public int getDepth() {
        return depth;
    }

    /**
     * @param depth the depth to set
     */
    public void setDepth(int depth) {
        this.depth = depth;
    }

    /**
     * @return the productsInShop
     */
    public List<Product> getProductsInShop() {
        return productsInShop;
    }

    /**
     * @param productsInShop the productsInShop to set
     */
    public void setProductsInShop(List<Product> productsInShop) {
        this.productsInShop = productsInShop;
    }

    /**
     * @return the actualProducts
     */
    public List<ProductShop> getActualProducts() {
        return actualProducts;
    }

    /**
     * @param actualProducts the actualProducts to set
     */
    public void setActualProducts(List<ProductShop> actualProducts) {
        this.actualProducts = actualProducts;
    }

    /**
     * @return the actualNumberOfProducts
     */
    public int getActualNumberOfProducts() {
        return actualNumberOfProducts;
    }

    /**
     * @param actualNumberOfProducts the actualNumberOfProducts to set
     */
    public void setActualNumberOfProducts(int actualNumberOfProducts) {
        this.actualNumberOfProducts = actualNumberOfProducts;
    }

    /**
     * @return the actualPriceForProducts
     */
    public Double getActualPriceForProducts() {
        return actualPriceForProducts;
    }

    /**
     * @param actualPriceForProducts the actualPriceForProducts to set
     */
    public void setActualPriceForProducts(Double actualPriceForProducts) {
        this.actualPriceForProducts = actualPriceForProducts;
    }

    /**
     * @return the totalPrice
     */
    public Double getTotalPrice() {
        return totalPrice;
    }

    /**
     * @param totalPrice the totalPrice to set
     */
    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }

    /**
     * @return the nodeToVisit
     */
    public List<Node> getNodeToVisit() {
        return nodeToVisit;
    }

    /**
     * @param nodeToVisit the nodeToVisit to set
     */
    public void setNodeToVisit(List<Node> nodeToVisit) {
        this.nodeToVisit = nodeToVisit;
    }

    /**
     * @return the time
     */
    public Double getTime() {
        return time;
    }

    /**
     * @param time the time to set
     */
    public void setTime(Double time) {
        this.time = time;
    }
    
    
    
    
    
}
